import type { UserConfig } from 'vitepress'

import {
  containerPreview,
  componentPreview,
} from '@vitepress-demo-preview/plugin'

const config: UserConfig = {
  title: 'cow-plus',
  description: '一个非常牛的vue3 ui库',
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: '首页', link: '/' },
      { text: '文档', link: '/markdown-examples' },
    ],

    sidebar: {
      // 当用户位于 `guide` 目录时，会显示此侧边栏
      '/component/': [
        {
          text: 'Basic 基础组件',
          items: [
            { text: 'Button按钮', link: '/component/button' },
            { text: 'Icon图标', link: '/component/icon' },
          ],
        },
        {
          text: 'Feedback 反馈组件',
          items: [{ text: 'Dialog 对话框', link: '/component/dialog' }],
        },
      ],
    },

    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' },
    ],
  },
  markdown: {
    config(md) {
      md.use(containerPreview)
      md.use(componentPreview)
    },
  },
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          javascriptEnabled: true,
        },
      },
    },
  },
}

export default config
